//区分是哪个项目的存储
export const KEY='TEA_APP'//所有的键拼上前缀

export const set=(key,val)=>{
    window.localStorage.setItem(KEY+key,JSON.stringify(val))
}
export const get=key=>{
    return JSON.parse(window.localStorage.getItem(KEY+key))
}
export const clear=()=>{//清除本项目的数据
    for(let k in window.localStorage){
        if(k.startsWith(KEY)){
            window.localStorage.removeItem(k)
        }
    }
    
}